<?php
/**
 * 平台首页
**/
include("../includes/common.php");
$title='平台首页';
if($conf['forcelogin']==1 && !$islogin2) {loginsmsg('请登录后再操作！');}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="../favicon.ico" rel="icon">
    <title><?php echo $conf['title']?> - 用户端</title>
    <meta name="keywords" content="<?=$conf['keywords']?>"/>
  <meta name="description" content="<?=$conf['description']?>"/>
    <meta name="author" content="yinqi">
    <link rel="stylesheet" href="../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../assets/module/admin.css?v=318"/>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <img src="../favicon.ico"/>
            <cite>&nbsp;<?php echo $conf['title']?></cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
          <?php if($conf['userlogin']){ ?>
             <?php if($islogin2){ ?>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <cite><i class="fab fa-<?php echo $userrow['type']=='qq'?'qq':'wechat';?>"></i><?php echo $userrow['nickname']?></cite>
                </a>
                <dl class="layui-nav-child">
                    <dd lay-unselect><a  href="javascript:logout()" style="text-align: center;">退出</a></dd>
                </dl>
            </li>
            <?php }else{ ?>
               <li class="layui-nav-item" lay-unselect>
                <a>
                    <cite><i class="fab fa-<?php echo $userrow['type']=='qq'?'qq':'wechat';?>"></i>未登录</cite>
                </a>
                <dl class="layui-nav-child">
                    <dd lay-unselect><a  href="./login.php" style="text-align: center;">点击登录</a></dd>
                </dl>
            </li>
               <?php } ?>
          <?php } ?>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>
            </li>
        </ul>
    </div>
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-shrink="_all">
                <li class="layui-nav-item">
                    <a><i class="layui-icon layui-icon-home"></i>&emsp;<cite>Dashboard</cite></a>
                    <dl class="layui-nav-child">
                        <dd><a lay-href="user.php">控制台</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a lay-href="home.php?m=mine"><i class="layui-icon layui-icon-upload-drag"></i>&emsp;<cite>我的文件</cite></a>
                </li>
                <li class="layui-nav-item">
                    <a lay-href="upload.php"><i class="layui-icon layui-icon-upload-drag"></i>&emsp;<cite>上传文件</cite></a>
                </li>
            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>
    <!-- 底部 -->
    <div class="layui-footer layui-text">
        copyright © <?php echo date("Y")?> <a><?php echo $conf['title'];?></a> all rights reserved.
        <span class="pull-right"><?php echo $auth_info['app_version'];?></span>
    </div>
</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../assets/js/common.js?v=318"></script>
<script type="text/javascript">
    layui.use(['index','layer'], function () {
        var $ = layui.jquery;
        var index = layui.index;
        var layer = layui.layer;
        // 默认加载主页
        index.loadHome({
            menuPath: 'user.php',
            menuName: '<i class="layui-icon layui-icon-home"></i>'
        });
        window.logout = function() {
            layer.confirm('您是否退出本次登录？', {btn: ['确定', '取消'], icon: 3},
                function() {
                    var ii = layer.load(2, {
                        shade: [0.1, '#fff']
                    });
                    $.ajax({
                        type: "get",
                        url: "./login.php?logout=1",
                        dataType: 'json',
                        success: function(data) {
                            layer.close(ii);
                            if (data.code == 1) {
                                layer.msg(data.msg, {
                                    icon: 1,
                                    time: 1000,
                                    end: function() {
                                        window.location.href = "./login.php"
                                    }
                                });
                            }
                        }
                    });
                },
            function() {});
        };
    });
</script>
</body>
</html>